<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<rich:panel header="#{messages['sub.agent.list']} - #{agentSubAgentBean.label}">
	<rich:dataTable id="data" var="agent" value="#{agentSubAgentBean.subAgentList}" rows="10" width="99%" >
		<rich:column style="text-align:center;width:5%;" >
			<f:facet name="header">
				<h:selectBooleanCheckbox id="chkAll" onclick="checkAll(this.form,this)" ></h:selectBooleanCheckbox>
			</f:facet>
			<h:selectBooleanCheckbox id="chk" value=""></h:selectBooleanCheckbox>
		</rich:column>
		<rich:column style="text-align:center;width:30%;">
			<f:facet name="header">
				<h:outputText value="#{messages['code']}"></h:outputText>
			</f:facet>
			<h:commandLink value="#{agent.code}" action="#{agentSubAgentBean.navEditAction}" 
			actionListener="#{agentSubAgentBean.editActionListener}"></h:commandLink>
			<f:param id="agentId" value="#{agent.agentId}"/>
		</rich:column>
		<rich:column style="text-align:center;width:15%;">
			<f:facet name="header">
				<h:outputText value="#{messages['contact.person']}"></h:outputText>
			</f:facet>
			<t:outputText styleClass="standardText" value="#{agent.contactPerson}"></t:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:15%;">
			<f:facet name="header">
				<h:outputText value="#{messages['action']}"></h:outputText>
			</f:facet>
			<h:commandButton value="#{messages['view.sub.agent.action']}" actionListener="#{agentSubAgentBean.viewSubAgentActionListener}" 
			action="#{agentSubAgentBean.viewSubAgentAction}" styleClass="button"></h:commandButton>
			<f:param id="vagentId" value="#{agent.agentId}"/>
		</rich:column>
	</rich:dataTable>
	
	<rich:spacer height="30" />
	
	<rich:datascroller align="left"  for="data" maxPages="20" />

	<rich:spacer height="30" />
	
	<t:panelGrid columns="1" width="100%">
		<t:panelGroup>
			<h:commandButton value="#{messages['delete']}" rendered="#{agentSubAgentBean.flag}" 
			styleClass="button"  action="#{agentSubAgentBean.deleteAction}"></h:commandButton>
		 	<f:verbatim>&nbsp;</f:verbatim>
		 	<h:commandButton value="#{messages['create']}" rendered="#{agentSubAgentBean.flag}" 
		 	styleClass="button"  action="#{agentSubAgentBean.navCreateAction}"></h:commandButton>
		 	<f:verbatim>&nbsp;</f:verbatim>
   			<h:commandButton value="#{messages['cancel']}" rendered="#{agentSubAgentBean.flag}" 
   			styleClass="button" immediate="true" action="#{agentSubAgentBean.navBackAction}"></h:commandButton>
   			<h:commandButton value="#{messages['back']}" rendered="#{!agentSubAgentBean.flag}"
   			styleClass="button" immediate="true" action="#{agentSubAgentBean.navBackSubAgentAction}"></h:commandButton>
   		</t:panelGroup>
	</t:panelGrid>
</rich:panel>
